import Vue from 'vue'
import Router from 'vue-router'
// import HelloWorld from '@/pages/HelloWorld'
const HelloWorld = r => require.ensure([], () => r(require('@/pages/HelloWorld')), 'HelloWorld')
const Home = r => require.ensure([], () => r(require('@/pages/Home')), 'Home')
const Login = r => require.ensure([], () => r(require('@/pages/Login')), 'Login')
const Order = r => require.ensure([], () => r(require('@/pages/Order')), 'Order')
const MyCenter = r => require.ensure([], () => r(require('@/pages/MyCenter')), 'MyCenter')
const SocialInfo = r => require.ensure([], () => r(require('@/pages/SocialInfo')), 'SocialInfo')
const SocialCalculate = r => require.ensure([], () => r(require('@/pages/SocialCalculate')), 'SocialCalculate')
const EditBaseInfo = r => require.ensure([], () => r(require('@/pages/EditBaseInfo')), 'EditBaseInfo')
const EditSocialInfo = r => require.ensure([], () => r(require('@/pages/EditSocialInfo')), 'EditSocialInfo')
const ChangePwd = r => require.ensure([], () => r(require('@/pages/ChangePwd')), 'ChangePwd')
const About = r => require.ensure([], () => r(require('@/pages/About')), 'About')
const MsgList = r => require.ensure([], () => r(require('@/pages/MsgList')), 'MsgList')
const Test = r => require.ensure([], () => r(require('@/pages/Test')), 'Test')
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      meta: {
        title: '首页'
      }
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
      meta: {
        title: '登录'
      }
    },
    {
      path: '/order',
      name: 'Order',
      component: Order,
      meta: {
        title: '订单'
      }
    },
    {
      path: '/mycenter',
      name: 'MyCenter',
      component: MyCenter,
      meta: {
        title: '个人中心'
      }
    },
    {
      path: '/socialinfo',
      name: 'SocialInfo',
      component: SocialInfo,
      meta: {
        title: '参保信息'
      }
    },
    {
      path: '/socialcalculate',
      name: 'SocialCalculate',
      component: SocialCalculate,
      meta: {
        title: '社保计算器'
      }
    },
    {
      path: '/editbaseinfo',
      name: 'EditBaseInfo',
      component: EditBaseInfo,
      meta: {
        title: '基础信息'
      }
    },
    {
      path: '/editsocialinfo',
      name: 'EditSocialInfo',
      component: EditSocialInfo,
      meta: {
        title: '编辑参保信息'
      }
    },
    {
      path: '/changepwd',
      name: 'ChangePwd',
      component: ChangePwd,
      meta: {
        title: '修改密码'
      }
    },
    {
      path: '/about',
      name: 'About',
      component: About,
      meta: {
        title: '关于'
      }
    },
    {
      path: '/msglist',
      name: 'MsgList',
      component: MsgList,
      meta: {
        title: '消息列表'
      }
    },
    {
      path: '/hello',
      name: 'Hello',
      component: HelloWorld
    },
    {
      path: '/test',
      name: 'Test',
      component: Test
    }
  ]
})
